package com.yang.booking.service;

import com.yang.booking.dao.RoomMapper;
import com.yang.booking.pojo.Room;
import com.yang.booking.pojo.Store;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

@Service
public class RoomService {

    @Autowired
    private RoomMapper roomMapper;

    public Map<String, Object> insertRoom(String storeId, String name){

        Room room = new Room();
        room.setStoreId(storeId);
        room.setName(name);
        room.setCreateAt(new Date());
        room.setUpdateAt(new Date());
        roomMapper.insert(room);

        Map<String, Object> msg = new HashMap<String, Object>();
        msg.put("massage", "插入成功");
        msg.put("code", 200);
        return msg;
    }
}
